﻿using Reborn.Net.Http.Drive;
using Reborn.Net.Http.Extension;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Reborn.Net.Http
{
    public class HttpFactoty
    {

        public static HttpClientX Build(HttpConfig httpConfig = null)
        {
            if(httpConfig == null) httpConfig = new HttpConfig();

            Drive.Drive httpClient = null;
            switch (httpConfig.DriveType)
            {
                case DriveType.HttpClient:
                    httpClient = new Drive.HttpClientDrive(httpConfig);
                    break;
                case DriveType.RestSharp:
                    httpClient = new RestSharpDrive(httpConfig);
                    break;
            }


            HttpClientX httpClientX = new HttpClientX(httpClient);

            return httpClientX;
        }
    }
}
